package com.example.myfirstapplication.utils

import android.app.Activity

object ActivityCollector {
    private val activities = ArrayList<Activity>()

    fun add(_act: Activity) {
        activities.add(_act)
    }

    fun remove(_act: Activity) {
        activities.remove(_act)
    }

    fun finishAll() {
        for (item in activities) {
            if (!item.isFinishing ){
                item.finish()
            }
        }
    }
}